package jf.jextn.converter;

/**
 * The class <code>ConverterFacade</code> hide the non-converter (or say
 * configuration) API of the wrapped converter.
 * 
 * @author Sandeep Kadyan
 * 
 * @param <V>
 *            value type
 * @param <O>
 *            object type
 */
public class ConverterFacade<V, O> implements Converter<V, O> {

    private Converter<V, O> converter;

    public ConverterFacade(Converter<V, O> converter) {
        this.converter = converter;
    }

    @Override
    public O from(V value) {
        return converter.from(value);
    }

    @Override
    public V to(O o) {
        return converter.to(o);
    }

    @Override
    public String toString() {
        return "Facade Converter (" + converter + ")";
    }

}
